package com.zzyl.nursing.service.impl;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzyl.common.utils.StringUtils;
import com.zzyl.nursing.domain.pojo.NursingProject;
import com.zzyl.nursing.mapper.MemberServicesMapper;
import com.zzyl.nursing.service.MemberServicesService;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MemberServicesServiceImpl extends ServiceImpl<MemberServicesMapper,NursingProject> implements MemberServicesService {
    @Override
    public List<NursingProject> selectNursingProjectList(NursingProject nursingProject) {
        return this.list(Wrappers.<NursingProject>lambdaQuery()
                .like(StringUtils.isNotEmpty(nursingProject.getName()), NursingProject::getName, nursingProject.getName())
                .eq(ObjectUtils.isNotNull(nursingProject.getStatus()), NursingProject::getStatus, nursingProject.getStatus()));
    }

    @Override
    public NursingProject getOneInfoById(Integer id) {
         return this.getById(id);
    }
}
